Skip to content

Fix waterfall chart negative bar labels#864

Merged
anth-volk merged 1 commit intomainfrom
fix/waterfall-negative-values
Mar 25, 2026
Merged

Fix waterfall chart negative bar labels#864
anth-volk merged 1 commit intomainfrom
fix/waterfall-negative-values

Conversation

@anth-volk
Copy link
Collaborator

Summary

  • Waterfall chart bar labels displayed cumulative stack-top values instead of actual datum values for negative bars (e.g. showing "$49.3bn" instead of "-$7.5bn")
  • Use data[idx].value instead of Recharts' props.value in the label renderer

Fixes #863

🤖 Generated with Claude Code

Use datum.value instead of Recharts' props.value for bar labels.
For stacked bars, props.value is the cumulative stack-top, not the
individual bar's value, causing negative bars to display incorrect labels.

Fixes #863

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Mar 25, 2026 5:56pm
policyengine-calculator Ready Ready Preview, Comment Mar 25, 2026 5:56pm
policyengine-website Ready Ready Preview, Comment Mar 25, 2026 5:56pm

Request Review

@anth-volk anth-volk marked this pull request as ready for review March 25, 2026 17:58
@anth-volk anth-volk merged commit 657cfe9 into main Mar 25, 2026
11 checks passed
@anth-volk anth-volk deleted the fix/waterfall-negative-values branch March 25, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Waterfall chart bar labels show cumulative stack value instead of actual value for negative bars

1 participant